﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web.controls
{
    public partial class login_status : System.Web.UI.UserControl
    {
         private int _uermod ;
        protected void Page_Load(object sender, EventArgs e)
        {
           // loadover();
        }

        public int uermod
        {
            get { return _uermod; }
            set { _uermod = value; }
        }

        public void loadover(bool t=false)
        {
            if (Session["USER"] != null && t)
            {
                study.Model.tb_user umod = (study.Model.tb_user)Session["USER"];
                userImage.ImageUrl = umod.uimg;
                username.Text = umod.username;
                note_nub.Text = umod.count.ToString();
                note_responsions.Text = umod.recount.ToString();
                regist_time.Text = umod.retime;
            }
            if (!t)
            {
                study.BLL.tb_user ubll = new study.BLL.tb_user();
                study.Model.tb_user umod = ubll.GetModel(uermod);
                if (umod != null)
                {
                    userImage.ImageUrl = umod.uimg;
                    username.Text = umod.username;
                    note_nub.Text = umod.count.ToString();
                    note_responsions.Text = umod.recount.ToString();
                    regist_time.Text = umod.retime;
                }
            }
        }

    
    }
}